import {connect} from "react-redux";
import {getReserverOrderDetail} from "../apis/reserveOrderApi";
import OrderDetail from "../components/OrderDetail/OrderDetail";
import {addOrderDetail} from "../actions/home";

const mapStateToProps = (state) => ({
    orderDetail: state.orderReducer
});

const mapDispatchToProps = (dispatch) => ({
    getReserverOrderDetail: async (id) => {
        const data = await getReserverOrderDetail(id);
        dispatch(addOrderDetail(data));
    }
});

const ReserveOrderDetailContainer = connect(mapStateToProps, mapDispatchToProps)(OrderDetail);
export default ReserveOrderDetailContainer;